<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>编辑留言</title>
    <style>
        :root {
            --primary-color: #4e7de4;
            --secondary-color: #eef2ff;
            --text-color: #333;
            --light-gray: #f5f7fa;
            --border-color: #e1e4e8;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }

        body {
            background-color: var(--light-gray);
            color: var(--text-color);
            line-height: 1.6;
            padding: 20px;
            max-width: 800px;
            margin: 0 auto;
        }

        h1 {
            text-align: center;
            color: var(--primary-color);
            margin: 20px 0;
            font-weight: 600;
            padding-bottom: 10px;
            border-bottom: 2px solid var(--secondary-color);
        }

        form {
            background-color: white;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
            margin-bottom: 30px;
        }

        textarea {
            width: 100%;
            padding: 12px;
            border: 1px solid var(--border-color);
            border-radius: 4px;
            resize: vertical;
            font-size: 16px;
            transition: border-color 0.3s, box-shadow 0.3s;
        }

        textarea:focus {
            outline: none;
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px rgba(78, 125, 228, 0.2);
        }

        input[type="submit"] {
            background-color: var(--primary-color);
            color: white;
            border: none;
            padding: 12px 20px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 16px;
            margin-top: 15px;
            transition: background-color 0.3s;
        }

        input[type="submit"]:hover {
            background-color: #3968cf;
        }

        a.back-link {
            display: inline-block;
            margin-top: 20px;
            color: var(--primary-color);
            text-decoration: none;
            padding: 10px 15px;
            border-radius: 4px;
            border: 1px solid var(--primary-color);
            transition: background-color 0.3s, color 0.3s;
        }

        a.back-link:hover {
            background-color: var(--primary-color);
            color: white;
        }

        .edit-container {
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        @media (max-width: 600px) {
            body {
                padding: 10px;
            }

            form {
                padding: 15px;
            }

            input[type="submit"] {
                width: 100%;
            }
        }
    </style>
</head>
<body>
<div class="edit-container">
    <h1>编辑留言</h1>
    <form action="{{ url_for('update_message', message_id=message[0]) }}" method="post">
        <label>
            <textarea name="content" rows="4" cols="50">{{ message[1] }}</textarea>
        </label>
        <br>
        <input type="submit" value="保存修改">
    </form>
    <a href="{{ url_for('index') }}" class="back-link">返回留言板</a>
</div>
</body>
</html>
